Question : Argument of type 'string | null' is not assignable to parameter of type 'string'. Type 'null' is not assignable to type 'string'.
Answered by : crazy-cicada-s647621we6xq
JSON.parse(localStorage.getItem('user') as string);
or
JSON.parse(localStorage.getItem('user') as any);
Source : | Last Update : Fri, 29 Jul 22
Question : Argument of type 'string | null' is not assignable to parameter of type 'string'. Type 'null' is not assignable to type 'string'.
Answered by : sarthhak-kachwha
Argument of type 'string | null' is not assignable to parameter of type 'string'. Type 'null' is not assignable to type 'string'. route.paramMap.get('id')
ANS-
route.paramMap.get('id')!
Source : | Last Update : Fri, 20 May 22